import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";



const routes: Array<RouteRecordRaw> = [
  { path: '/', component: () => import('@/views/Home/index.vue') },
  { path: '/video/:id', component: () => import('@/views/Video/index.vue') },
  { path: '/search', component: () => import('@/views/Search/index.vue') },

  // not found 路由
  { path: '/:pathMatch(.*)*', name: 'NotFound', component: () => import('@/components/app-NotFound.vue') },
  {
    path: '/login', component: () => import('@/views/Login/index.vue'),
    children: [
      { path: 'login', component: () => import('@/views/Login/components/login-login.vue') },
      { path: 'user', component: () => import('@/views/Login/components/login-user.vue') },
    ]
  }


]



const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router